from ogreEx.blender.types import Operator
from ogreEx.context import getTundraSingleton
from ogreEx.ui.UIClass import OPERATOR

@OPERATOR
class Tundra_PhysicsDebugOp(Operator):
    '''TundraSingleton helper'''
    bl_idname = 'tundra.toggle_physics_debug'
    bl_label = "stop physics"
    bl_options = {'REGISTER'}
    
    @classmethod
    def poll(cls, context):
        if getTundraSingleton(): return True
    def invoke(self, context, event):
        getTundraSingleton().toggle_physics_debug()
        return {'FINISHED'}